// const express = require('express');
// var app = express();
// var cors = require('cors');
// app.use(cors({
//     origin:['http://localhost:8081'],
//     methods:['GET','POST'],
//     alloweHeaders:['Conten-Type', 'Authorization']
// }));
const express = require('express')
let route = express.Router()
var url = require('url');
let api = require('../controller/index');
const {connection} = require('../connect/connect');
const ct = require('../controller/ct');
const ad = require('../controller/advice');




route.get('/sellShow/mysell', api.getGoods)
route.get('/getUser',api.getUser)
route.post('/insertUser',api.insertUser)

route.post('/insertCollect',api.insertCollect)//添加收藏
route.get('/getCollect',api.getCollect)//获取收藏


route.post('/addCart',ct.addCart)
route.get('/getCart',ct.getCart)
route.get('/deleteCart',ct.deleteCart)


route.post('/addOrder',ct.addOrder)//订单操作
route.get('/getOrder',ct.getOrder)
route.get('/getOrderDetail',ct.getOrderDetail)
route.get('/deleteOrder',ct.deleteOrder)

route.post('/addAdvice',ad.addAdvice)
route.get('/AdviceBook',ad.AdviceBook)

exports.route = route;